package com.wsx.rpc.dubbo.service;

import com.wsx.rpc.api.ApiRequest;
import com.wsx.rpc.api.ApiResponse;
import com.wsx.rpc.api.ApiService;

import java.util.Date;

/**
 * @author wangshuaixin
 * @Title: com.wsx.rpc.dubbo.service.ApiServiceImpl
 * @Description: TODO
 * @date 2018/10/30
 */
public class ApiServiceImpl implements ApiService {
    @Override
    public ApiResponse exec(ApiRequest apiRequest) {
        ApiResponse response = new ApiResponse();
        response.setCode(apiRequest.getCode() + 2);
        response.setMsg(apiRequest.getMsg() + 2);
        response.setDays(apiRequest.getDays());

        response.setList(apiRequest.getList());
        response.setMap(apiRequest.getMap());
        response.setMoney(apiRequest.getMoney() + 2);
        response.setName(apiRequest.getName() + 2);
        response.setStatus(apiRequest.getStatus() + 2);
        response.setTime(new Date());

        response.setTitle(apiRequest.getTitle() + 2);
        try {
            Thread.sleep(5);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return response;
    }
}
